package com.tanhua.dubbo.api.impl;

import com.tanhua.domain.db.UserFreeze;
import com.tanhua.dubbo.api.FreezeApi;
import com.tanhua.dubbo.mapper.UserFreezeMapper;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Query;

import java.sql.Wrapper;

/**
 * 用户服务类，导入dubbo提供的@Service注解
 * 导入的包：org.apache.dubbo.config.annotation.Service;
 */
@Service
public class FreezeApiImpl implements FreezeApi {


    @Autowired
    private UserFreezeMapper userFreezeMapper;



    /**
     * 冻结账号
     */
    @Override
    public Integer save(UserFreeze userFreeze) {
        return userFreezeMapper.save(userFreeze);
    }

    /**
     * 删除冻结表中的冻结记录
     * @param userId
     */
    @Override
    public void delectUnfreeze(Integer userId) {

        userFreezeMapper.delectUnfreeze(userId);
    }

    @Override
    public UserFreeze select(Long userId) {
        UserFreeze userFreeze = userFreezeMapper.selectFreeze(userId);


        return userFreeze;
    }
}
